#include "../../externals/PixelToaster.h"
#include "basics.h"
#include "vector.h"
#include "matrix.h"
#include <math.h>

// ==================================================================================================
// Find the dot product of two vectors
// ==================================================================================================
__forceinline float DotProduct(const Vector4& v1, const Vector4& v2) {
	return (v1.x*v2.x + v1.y*v2.y + v1.z*v2.z);
}

// =================================================================================================
// Find the intersection with a plane and a ray
// =================================================================================================
void PlaneIntersection(const Vector4& or, const Vector4& dir, Plane& plane, float max, 
	                    float& sample, PixelToaster::Pixel& pixel);

// =================================================================================================
// Rotation functions
// =================================================================================================
void RotateX(float radians, Matrix4x4& mat);
void RotateY(float radians, Matrix4x4& mat);
void RotateZ(float radians, Matrix4x4& mat);

// =================================================================================================
// Rotate about an arbitrary axis
// $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
// Still needs work
// =================================================================================================
void RotateArb(const Vector4& vec, float radians, Matrix4x4& mat);
